//
//  CategoryCell.m
//  LittleSugar
//
//  Created by zhang on 15-6-16.
//  Copyright (c) 2015年 张鑫. All rights reserved.
//

#import "CategoryCell.h"
@interface CategoryCell()


@end

@implementation CategoryCell

- (void)awakeFromNib {
    self.iconImageView.layer.masksToBounds = YES;
    self.iconImageView.layer.cornerRadius = 22;
}

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self createViewWithFrame:frame];
        self.iconImageView.layer.masksToBounds = YES;
        self.iconImageView.layer.cornerRadius = 22;
    }
    return self;
}
int i = 0;
- (void)createViewWithFrame:(CGRect)frame {
    NSString *path = [[NSBundle mainBundle] pathForResource:@"categorys" ofType:@"plist"];
    NSArray *arr = [NSArray arrayWithContentsOfFile:path];
    NSDictionary *dict = arr[i];
    _iconImageView = [[UIImageView alloc] initWithFrame:CGRectMake(20, 20, 44, 44)];
    [self.contentView addSubview:_iconImageView];
    _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(74, 22, 50, 20)];
    
    _titleLabel.font = [UIFont systemFontOfSize:14];
    _titleLabel.backgroundColor = [UIColor clearColor];
    [self.contentView addSubview:_titleLabel];
    _engLebel = [[UILabel alloc] initWithFrame:CGRectMake(74, 40, 60, 20)];
    _engLebel.font = [UIFont systemFontOfSize:12];
    _engLebel.backgroundColor = [UIColor clearColor];
    [self.contentView addSubview:_engLebel];
    _iconImageView.image = [UIImage imageNamed:dict[@"categoryImage"]];
    _titleLabel.text = dict[@"title"];
    _engLebel.text = dict[@"engTltle"];
    [_titleLabel setFont:[UIFont fontWithName:@"Verdana" size:14]];
    _titleLabel.alpha = 0.9;
    _engLebel.alpha = 0.5;
    [_engLebel setFont:[UIFont fontWithName:@"Verdana" size:11]];
    i++;
}

@end
